package junitTests;

import com.thoughtworks.selenium.*;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import java.util.regex.Pattern;

public class ForgotPasswordTest extends SeleneseTestCase {
	@Before
	public void setUp() throws Exception {
		selenium = new DefaultSelenium("localhost", 4444, "*chrome", "http://localhost:8888/");
		selenium.start();
	}

	@Test
	public void testForgotPassword() throws Exception {
		selenium.open("/login.jsp");
		assertEquals("Login | Media Vault", selenium.getTitle());
		selenium.click("link=Forgot Password");
		selenium.click("id=forgot_password");
		verifyTrue(selenium.isTextPresent("Password recovery is successful. Your User login deatils has been sent to your email. Please check your mails."));
	}

	@After
	public void tearDown() throws Exception {
		selenium.stop();
	}
}
